import React from 'react'
import { Navigate } from 'react-router-dom'
import {  message } from 'antd';
export default function AuthComponent({children}) {
  if (localStorage.token) {
    return (
      <>
      {children}
      </>
    )
  }else{
    message.success('请登录')
    return <Navigate to={'/login'}></Navigate>
  }
  
}
